import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [{
      path: '/',
      name: 'Home',
      // 异步加载方法  app.js很大时才用  这里其实不需要  最好是放在上面引入
      component: () => import('@/pages/home/Home')
    }, {
      path: '/city',
      name: 'City',
      component: () => import('@/pages/city/City')
    }, {
      path: '/detail/:id',
      name: 'Detail',
      component: () => import('@/pages/detail/Detail')
    }, {
      path: '/weekendDetail/:id',
      name: 'WeekendDetail',
      component: () => import('@/pages/weekendDetail/WeekendDetail')
    }, {
      path: '/order',
      name: 'Order',
      component: () => import('@/pages/order/Order')
    }],
    scrollBehavior (to, from, savedPosition) {
      return { x: 0, y: 0 }
    }
})
